package com.sl.biz.modular.cdc.controller;

import com.sl.biz.modular.cdc.controller.domain.request.CdcPropertiesConfigSaveRequest;
import com.sl.biz.modular.cdc.dao.domain.entity.CdcPropertiesConfigDO;
import com.sl.biz.modular.cdc.service.CdcPropertiesBizService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cdc/properties")
@RequiredArgsConstructor
public class CdcPropertiesController {

    private final CdcPropertiesBizService cdcPropertiesBizService;


    @PostMapping("/query_by_cdc_id")
    public List<CdcPropertiesConfigDO> queryByCdcId(@RequestBody CdcPropertiesConfigDO jobConfigDO) {
        return cdcPropertiesBizService.queryByCdcId(jobConfigDO);
    }

    @PostMapping("/remove_by_id")
    public Boolean removeById(@RequestBody CdcPropertiesConfigDO cdcConfigDO) {
        return cdcPropertiesBizService.removeById(cdcConfigDO);
    }

    @PostMapping("/save")
    public Boolean save(@RequestBody CdcPropertiesConfigSaveRequest configSaveRequest) {
        return cdcPropertiesBizService.save(configSaveRequest);
    }


}
